package com.teachoa.enumtype;

public enum ProjectStatusEnum {
	
	PRO(0, "创建中"),
	PROWAIT(1, "项目待审核"),
	PROSUCCESS(2, "项目审核通过"),
	TEAM(3, "团队创建中"),
	TEAMWAIT(4, "团队创建待审核"),
	TEAMSUCCESS(5, "团队创建审核通过"),
	START(6, "进行中"),
	END(7, "结束");
	
	private int code;
	private String desc;
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	private ProjectStatusEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static ProjectStatusEnum getEnumByCode(int code) {
		ProjectStatusEnum[] enums = ProjectStatusEnum.values();
		for(ProjectStatusEnum enumtype:enums) {
			if(enumtype.getCode()==code) {
				return enumtype;
			}
		}
		return null;
	}

}
